import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { MultiImgLibrary } from './multiImgLibrary.entity';

@Injectable()
export class MultiImgLibraryService {
  constructor(
    @InjectRepository(MultiImgLibrary)
    private multiImgLibraryRepository: Repository<MultiImgLibrary>,
  ) {}

  findAll(): Promise<MultiImgLibrary[]> {
    return this.multiImgLibraryRepository.find();
  }

  findOne(id: any): Promise<MultiImgLibrary> {
    return this.multiImgLibraryRepository.findOne(id);
  }

  async remove(id: number): Promise<void> {
    await this.multiImgLibraryRepository.delete(id);
  }

  async create(multiImgLibrary: MultiImgLibrary): Promise<void> {
    await this.multiImgLibraryRepository.save(multiImgLibrary);
  }
}
